<?php if($mode == 1) { echo script::add('jquery'), script::add('form'), script::ajax_form('#form_box', 'request', 'response'); ?>
<script type="text/javascript">function request() {var file_name=$('#file_box').val();if(file_name==''){alert('上传文件不能为空!');$('#file_box').focus();return false;}} function response(data) {switch(data){case '101':alert('操作成功!');location.reload();break; case '100':alert('对不起,操作失败！请重新操作');break;default:alert(data);}}</script>
<?php } ?>
<table width="800" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30" align="left">>><?php echo $site_name; ?></td>
      </tr>
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="10" cellpadding="0">
          <tr>
		   <?php if($mode==0) {?>
            <td width="200" height="40" align="center" bgcolor="#CCCCCC">备份数据</td>
            <td width="200" align="center"><a href="<?php echo $this->get_self_url(); ?>?mode=1">恢复数据</a></td>
			<?php } else { ?>			
             <td width="200" align="center"><a href="<?php echo $this->get_self_url(); ?>?mode=0">备份数据</a></td>
			  <td width="200" height="40" align="center" bgcolor="#CCCCCC">恢复数据</td>			  
		    <?php } ?>
			<td width="200" align="center">&nbsp;</td>
          </tr>
		  <?php if($mode==0) { ?>
          <tr>
            <td height="50" colspan="3" align="center" bgcolor="#CCCCCC"><a href="<?php echo $this->get_action_url('export'); ?>" target="_blank">备份数据</a></td>
          </tr>
		  <?php } else  { ?>
		  <form action="<?php echo $this->get_action_url('import'); ?>" method="post" enctype="multipart/form-data" id="form_box" name="handle_form">
          <tr>
            <td height="50" colspan="3" align="center" bgcolor="#CCCCCC"><input type="file" name="db_file" id="file_box"/>&nbsp;<input name="send_button" type="submit" value="提交" /></td>
          </tr>
		  </form>
		  <?php } ?>
        </table></td>
      </tr>
</table>